In [1]:
import pandas as pd
df=pd.read_csv('cleaned_data.csv')
df
Out[1]:
SNO Category States_UT poverty malnutrition literacy drinking water electricity unemployment
0 1.0 State Andhra Pradesh 9.2 35.5 65.6 99.81125151 100 5.7
1 2.0 State Arunachal Pradesh 34.67 16 79.9 92.63657957 100 7.7
2 3.0 State Assam 31.98 29.4 84.9 74.72472158 100 7.1
3 4.0 State Bihar 33.74 38.7 64.7 96.28630888 100 10.6
4 5.0 State Chhattisgarh 39.93 40 74.1 99.59868138 99.67 2.6
5 6.0 State Goa 5.09 20.3 88.9 100 100 9.4
6 7.0 State Gujarat 16.63 34.2 80.7 100 100 3.4
7 8.0 State Haryana 11.16 28.8 77.3 99.71431711 100 9.8
8 9.0 State Himachal Pradesh 8.06 22.6 84.2 100 100 5.8
9 10.0 State Jharkhand 36.96 42.9 67.3 99.70510686 100 5.5
10 11.0 State Karnataka 20.91 32 75.7 100 100 3.9
11 12.0 State Kerala 7.05 18.7 94.6 99.35308848 100 10.4
12 13.0 State Madhya Pradesh 31.65 38.7 70.5 99.64891263 100 3.7
13 14.0 State Maharashtra 17.35 30.9 80.3 99.70219926 100 5.4
14 15.0 State Manipur 36.89 13 85.6 100 100 10.1
15 16.0 State Meghalaya 11.87 30 91.4 100 100 2.8
16 17.0 State Mizoram 20.4 11.3 98.5 100 100 7.3
17 18.0 State Nagaland 18.88 16.3 93.8 100 100 18.5
18 19.0 State Odisha 32.59 29.2 72.5 98.13119756 100 7.6
19 20.0 State Punjab 8.26 19.7 79.4 92.4089014 100 8.0
20 21.0 State Rajasthan 14.71 31.5 67.1 92.2759537 100 6.2
21 22.0 State Sikkim 8.19 11 86.2 100 100 3.3
22 23.0 State Tamil Nadu 11.28 23.5 80.7 99.39444338 100 7.2
23 24.0 State Telangana Null 30.8 67.4 100 100 8.8
24 25.0 State Tripura 14.05 23.8 89.9 84.84415213 100 10.5
25 26.0 State Uttar Pradesh 29.43 36.8 68.2 99.62768688 100 6.2
26 27.0 State Uttarakhand 11.26 18.7 79.0 99.26236621 100 9.5
27 28.0 State West Bengal 19.98 30.9 79.0 95.47820993 100 4.1
28 29.0 Union Territory Andaman and Nicobar Islands 1 Null 88.3 100 Null 13.8
29 30.0 Union Territory Chandigarh 21.81 Null 89.1 Null Null 7.8
30 31.0 Union Territory Dadra and Nagar Haveli 39.31 Null 77.7 Null Null 1.5
31 32.0 Union Territory Daman and Diu 9.86 Null 88.3 Null Null 0.0
32 33.0 Union Territory Delhi 9.91 28.1 86.4 Null 100 10.7
33 34.0 Union Territory Jammu and Kashmir 10.35 13 76.4 99.889989 100 5.6
34 35.0 Union Territory Ladakh 10.35 13 76.4 100 100 5.6
35 36.0 Union Territory Lakshadweep 2.77 Null 95.7 Null Null 32.0
36 37.0 Union Territory Puducherry 9.69 Null 89.5 95.88550984 100 8.7
37 NaN NaN India 21.92 33.4 74.6 97.44222839 99.99 6.2
38 NaN NaN Target 10.96 1.9 100.0 100 100 3.0
In [2]:
df.describe()
Out[2]:
SNO literacy unemployment
count 37.000000 39.000000 39.000000
mean 19.000000 81.276923 7.589744
std 10.824355 9.510699 5.331623
min 1.000000 64.700000 0.000000
25% 10.000000 75.150000 4.750000
50% 19.000000 80.300000 7.100000
75% 28.000000 88.600000 9.450000
max 37.000000 100.000000 32.000000
In [3]:
import plotly.express as px
fig = px.box(df, y="poverty")
fig.show()
In [4]:
fig = px.box(df, y="malnutrition")
fig.show()
In [5]:
fig = px.box(df, y="literacy")
fig.show()
In [6]:
fig = px.box(df, y="drinking water")
fig.show()
In [7]:
fig = px.box(df, y="electricity")
fig.show()
In [8]:
fig = px.box(df, y="unemployment")
fig.show()
In [9]:
import plotly.graph_objs as go
desc = {
    "poverty": "Percentage of population living below the national poverty line",
    "malnutrition": "Percentage of children under five years who are underweight",
    "literacy": "Percentage of persons (15 years and above) who are literate",
    "drinking water": "Percentage of rural population having improved source of drinking water",
    "electricity": "Percentage of households electrified ",
    "unemployment": "Unemployment rate (%) (15-59 years)",
}

parameters = ["poverty",
              "malnutrition",
              "literacy",
              "drinking water",
              "electricity",
              "unemployment"]


for i in range(1, 7):
    print(i, parameters[i-1])

n=1

parameter = parameters[n-1]

x = list()
y = list()

for i in range(37):
    val = df.loc[i, parameter]
    if(val != 'Null'):
        x.append(df.loc[i, 'States_UT'])
        y.append(round(float(df.loc[i, parameter]), 2))


india = round(float(df.loc[37, parameter]), 2)
target = round(float(df.loc[38, parameter]), 2)

fig = go.Figure()

fig.add_trace(
    go.Bar(
        x=x,
        y=y,
        marker=dict(color=y,
                    colorscale='viridis', showscale=True)
    )
)

fig.add_hline(y=target, line_color="red", annotation_text="Target",
              annotation_position="bottom right")
fig.add_hline(y=india, line_color="blue", annotation_text="India Average",
              annotation_position="bottom right")

fig.update_layout(
    go.Layout(
        title=desc[parameter],
        xaxis=dict(
            title='states/UT'
        ),
        yaxis=dict(
            title='value(in %)',
        )
    )
)

fig.show()
1 poverty
2 malnutrition
3 literacy
4 drinking water
5 electricity
6 unemployment
In [10]:
import plotly.graph_objs as go
desc = {
    "poverty": "Percentage of population living below the national poverty line",
    "malnutrition": "Percentage of children under five years who are underweight",
    "literacy": "Percentage of persons (15 years and above) who are literate",
    "drinking water": "Percentage of rural population having improved source of drinking water",
    "electricity": "Percentage of households electrified ",
    "unemployment": "Unemployment rate (%) (15-59 years)",
}

parameters = ["poverty",
              "malnutrition",
              "literacy",
              "drinking water",
              "electricity",
              "unemployment"]


for i in range(1, 7):
    print(i, parameters[i-1])

n=2

parameter = parameters[n-1]

x = list()
y = list()

for i in range(37):
    val = df.loc[i, parameter]
    if(val != 'Null'):
        x.append(df.loc[i, 'States_UT'])
        y.append(round(float(df.loc[i, parameter]), 2))


india = round(float(df.loc[37, parameter]), 2)
target = round(float(df.loc[38, parameter]), 2)

fig = go.Figure()

fig.add_trace(
    go.Bar(
        x=x,
        y=y,
        marker=dict(color=y,
                    colorscale='viridis', showscale=True)
    )
)

fig.add_hline(y=target, line_color="red", annotation_text="Target",
              annotation_position="bottom right")
fig.add_hline(y=india, line_color="blue", annotation_text="India Average",
              annotation_position="bottom right")

fig.update_layout(
    go.Layout(
        title=desc[parameter],
        xaxis=dict(
            title='states/UT'
        ),
        yaxis=dict(
            title='value(in %)',
        )
    )
)

fig.show()
1 poverty
2 malnutrition
3 literacy
4 drinking water
5 electricity
6 unemployment
In [11]:
import plotly.graph_objs as go
desc = {
    "poverty": "Percentage of population living below the national poverty line",
    "malnutrition": "Percentage of children under five years who are underweight",
    "literacy": "Percentage of persons (15 years and above) who are literate",
    "drinking water": "Percentage of rural population having improved source of drinking water",
    "electricity": "Percentage of households electrified ",
    "unemployment": "Unemployment rate (%) (15-59 years)",
}

parameters = ["poverty",
              "malnutrition",
              "literacy",
              "drinking water",
              "electricity",
              "unemployment"]


for i in range(1, 7):
    print(i, parameters[i-1])

n=3

parameter = parameters[n-1]

x = list()
y = list()

for i in range(37):
    val = df.loc[i, parameter]
    if(val != 'Null'):
        x.append(df.loc[i, 'States_UT'])
        y.append(round(float(df.loc[i, parameter]), 2))


india = round(float(df.loc[37, parameter]), 2)
target = round(float(df.loc[38, parameter]), 2)

fig = go.Figure()

fig.add_trace(
    go.Bar(
        x=x,
        y=y,
        marker=dict(color=y,
                    colorscale='viridis', showscale=True)
    )
)

fig.add_hline(y=target, line_color="red", annotation_text="Target",
              annotation_position="bottom right")
fig.add_hline(y=india, line_color="blue", annotation_text="India Average",
              annotation_position="bottom right")

fig.update_layout(
    go.Layout(
        title=desc[parameter],
        xaxis=dict(
            title='states/UT'
        ),
        yaxis=dict(
            title='value(in %)',
        )
    )
)

fig.show()
1 poverty
2 malnutrition
3 literacy
4 drinking water
5 electricity
6 unemployment
In [12]:
import plotly.graph_objs as go
desc = {
    "poverty": "Percentage of population living below the national poverty line",
    "malnutrition": "Percentage of children under five years who are underweight",
    "literacy": "Percentage of persons (15 years and above) who are literate",
    "drinking water": "Percentage of rural population having improved source of drinking water",
    "electricity": "Percentage of households electrified ",
    "unemployment": "Unemployment rate (%) (15-59 years)",
}

parameters = ["poverty",
              "malnutrition",
              "literacy",
              "drinking water",
              "electricity",
              "unemployment"]


for i in range(1, 7):
    print(i, parameters[i-1])

n=4

parameter = parameters[n-1]

x = list()
y = list()

for i in range(37):
    val = df.loc[i, parameter]
    if(val != 'Null'):
        x.append(df.loc[i, 'States_UT'])
        y.append(round(float(df.loc[i, parameter]), 2))


india = round(float(df.loc[37, parameter]), 2)
target = round(float(df.loc[38, parameter]), 2)

fig = go.Figure()

fig.add_trace(
    go.Bar(
        x=x,
        y=y,
        marker=dict(color=y,
                    colorscale='viridis', showscale=True)
    )
)

fig.add_hline(y=target, line_color="red", annotation_text="Target",
              annotation_position="bottom right")
fig.add_hline(y=india, line_color="blue", annotation_text="India Average",
              annotation_position="bottom right")

fig.update_layout(
    go.Layout(
        title=desc[parameter],
        xaxis=dict(
            title='states/UT'
        ),
        yaxis=dict(
            title='value(in %)',
        )
    )
)

fig.show()
1 poverty
2 malnutrition
3 literacy
4 drinking water
5 electricity
6 unemployment
In [13]:
import plotly.graph_objs as go
desc = {
    "poverty": "Percentage of population living below the national poverty line",
    "malnutrition": "Percentage of children under five years who are underweight",
    "literacy": "Percentage of persons (15 years and above) who are literate",
    "drinking water": "Percentage of rural population having improved source of drinking water",
    "electricity": "Percentage of households electrified ",
    "unemployment": "Unemployment rate (%) (15-59 years)",
}

parameters = ["poverty",
              "malnutrition",
              "literacy",
              "drinking water",
              "electricity",
              "unemployment"]


for i in range(1, 7):
    print(i, parameters[i-1])

n=5

parameter = parameters[n-1]

x = list()
y = list()

for i in range(37):
    val = df.loc[i, parameter]
    if(val != 'Null'):
        x.append(df.loc[i, 'States_UT'])
        y.append(round(float(df.loc[i, parameter]), 2))


india = round(float(df.loc[37, parameter]), 2)
target = round(float(df.loc[38, parameter]), 2)

fig = go.Figure()

fig.add_trace(
    go.Bar(
        x=x,
        y=y,
        marker=dict(color=y,
                    colorscale='viridis', showscale=True)
    )
)

fig.add_hline(y=target, line_color="red", annotation_text="Target",
              annotation_position="bottom right")
fig.add_hline(y=india, line_color="blue", annotation_text="India Average",
              annotation_position="bottom right")

fig.update_layout(
    go.Layout(
        title=desc[parameter],
        xaxis=dict(
            title='states/UT'
        ),
        yaxis=dict(
            title='value(in %)',
        )
    )
)

fig.show()
1 poverty
2 malnutrition
3 literacy
4 drinking water
5 electricity
6 unemployment
In [14]:
import plotly.graph_objs as go
desc = {
    "poverty": "Percentage of population living below the national poverty line",
    "malnutrition": "Percentage of children under five years who are underweight",
    "literacy": "Percentage of persons (15 years and above) who are literate",
    "drinking water": "Percentage of rural population having improved source of drinking water",
    "electricity": "Percentage of households electrified ",
    "unemployment": "Unemployment rate (%) (15-59 years)",
}

parameters = ["poverty",
              "malnutrition",
              "literacy",
              "drinking water",
              "electricity",
              "unemployment"]


for i in range(1, 7):
    print(i, parameters[i-1])

n=6

parameter = parameters[n-1]

x = list()
y = list()

for i in range(37):
    val = df.loc[i, parameter]
    if(val != 'Null'):
        x.append(df.loc[i, 'States_UT'])
        y.append(round(float(df.loc[i, parameter]), 2))


india = round(float(df.loc[37, parameter]), 2)
target = round(float(df.loc[38, parameter]), 2)

fig = go.Figure()

fig.add_trace(
    go.Bar(
        x=x,
        y=y,
        marker=dict(color=y,
                    colorscale='viridis', showscale=True)
    )
)

fig.add_hline(y=target, line_color="red", annotation_text="Target",
              annotation_position="bottom right")
fig.add_hline(y=india, line_color="blue", annotation_text="India Average",
              annotation_position="bottom right")

fig.update_layout(
    go.Layout(
        title=desc[parameter],
        xaxis=dict(
            title='states/UT'
        ),
        yaxis=dict(
            title='value(in %)',
        )
    )
)

fig.show()
1 poverty
2 malnutrition
3 literacy
4 drinking water
5 electricity
6 unemployment
In [15]:
df = pd.read_csv('cleaned_data.csv')
df.set_index('States_UT', inplace=True)

desc = {
    "poverty": "Percentage of population living below the national poverty line",
    "malnutrition": "Percentage of children under five years who are underweight",
    "literacy": "Percentage of persons (15 years and above) who are literate",
    "drinking water": "Percentage of rural population having improved source of drinking water",
    "electricity": "Percentage of households electrified ",
    "unemployment": "Unemployment rate (%) (15-59 years)",
}

L = ["Andhra Pradesh",
     "Arunachal Pradesh",
     "Assam",
     "Bihar",
     "Chhattisgarh",
     "Goa",
     "Gujarat",
     "Haryana",
     "Himachal Pradesh",
     "Jharkhand",
     "Karnataka",
     "Kerala",
     "Madhya Pradesh",
     "Maharashtra",
     "Manipur",
     "Meghalaya",
     "Mizoram",
     "Nagaland",
     "Odisha",
     "Punjab",
     "Rajasthan",
     "Sikkim",
     "Tamil Nadu",
     "Telangana",
     "Tripura",
     "Uttar Pradesh",
     "Uttarakhand",
     "West Bengal",
     "Andaman and Nicobar Islands",
     "Chandigarh",
     "Dadra and Nagar Haveli",
     "Daman and Diu",
     "Delhi",
     "Jammu and Kashmir",
     "Ladakh",
     "Lakshadweep",
     "Puducherry"]

for i in range(1, len(L)+1):
    print(i, L[i-1])

n = 1

name = L[n-1]

x = list()
y = list()

for key in desc:
    val = df.loc[name, key]
    if(val == 'Null'):
        continue
    else:
        y.append(round(float(val), 2))
        x.append(key)

df = pd.DataFrame(dict(
    r=y,
    theta=x))

fig = px.line_polar(df, r='r', theta='theta', line_close=True, title=name)
fig.update_traces(fill='toself')
fig.show()
1 Andhra Pradesh
2 Arunachal Pradesh
3 Assam
4 Bihar
5 Chhattisgarh
6 Goa
7 Gujarat
8 Haryana
9 Himachal Pradesh
10 Jharkhand
11 Karnataka
12 Kerala
13 Madhya Pradesh
14 Maharashtra
15 Manipur
16 Meghalaya
17 Mizoram
18 Nagaland
19 Odisha
20 Punjab
21 Rajasthan
22 Sikkim
23 Tamil Nadu
24 Telangana
25 Tripura
26 Uttar Pradesh
27 Uttarakhand
28 West Bengal
29 Andaman and Nicobar Islands
30 Chandigarh
31 Dadra and Nagar Haveli
32 Daman and Diu
33 Delhi
34 Jammu and Kashmir
35 Ladakh
36 Lakshadweep
37 Puducherry
In [16]:
df = pd.read_csv('cleaned_data.csv')
df.set_index('States_UT', inplace=True)

desc = {
    "poverty": "Percentage of population living below the national poverty line",
    "malnutrition": "Percentage of children under five years who are underweight",
    "literacy": "Percentage of persons (15 years and above) who are literate",
    "drinking water": "Percentage of rural population having improved source of drinking water",
    "electricity": "Percentage of households electrified ",
    "unemployment": "Unemployment rate (%) (15-59 years)",
}

L = ["Andhra Pradesh",
     "Arunachal Pradesh",
     "Assam",
     "Bihar",
     "Chhattisgarh",
     "Goa",
     "Gujarat",
     "Haryana",
     "Himachal Pradesh",
     "Jharkhand",
     "Karnataka",
     "Kerala",
     "Madhya Pradesh",
     "Maharashtra",
     "Manipur",
     "Meghalaya",
     "Mizoram",
     "Nagaland",
     "Odisha",
     "Punjab",
     "Rajasthan",
     "Sikkim",
     "Tamil Nadu",
     "Telangana",
     "Tripura",
     "Uttar Pradesh",
     "Uttarakhand",
     "West Bengal",
     "Andaman and Nicobar Islands",
     "Chandigarh",
     "Dadra and Nagar Haveli",
     "Daman and Diu",
     "Delhi",
     "Jammu and Kashmir",
     "Ladakh",
     "Lakshadweep",
     "Puducherry"]

for i in range(1, len(L)+1):
    print(i, L[i-1])

n = 4

name = L[n-1]

x = list()
y = list()

for key in desc:
    val = df.loc[name, key]
    if(val == 'Null'):
        continue
    else:
        y.append(round(float(val), 2))
        x.append(key)

df = pd.DataFrame(dict(
    r=y,
    theta=x))

fig = px.line_polar(df, r='r', theta='theta', line_close=True, title=name)
fig.update_traces(fill='toself')
fig.show()
1 Andhra Pradesh
2 Arunachal Pradesh
3 Assam
4 Bihar
5 Chhattisgarh
6 Goa
7 Gujarat
8 Haryana
9 Himachal Pradesh
10 Jharkhand
11 Karnataka
12 Kerala
13 Madhya Pradesh
14 Maharashtra
15 Manipur
16 Meghalaya
17 Mizoram
18 Nagaland
19 Odisha
20 Punjab
21 Rajasthan
22 Sikkim
23 Tamil Nadu
24 Telangana
25 Tripura
26 Uttar Pradesh
27 Uttarakhand
28 West Bengal
29 Andaman and Nicobar Islands
30 Chandigarh
31 Dadra and Nagar Haveli
32 Daman and Diu
33 Delhi
34 Jammu and Kashmir
35 Ladakh
36 Lakshadweep
37 Puducherry
In [17]:
df = pd.read_csv('cleaned_data.csv')
df.set_index('States_UT', inplace=True)

desc = {
    "poverty": "Percentage of population living below the national poverty line",
    "malnutrition": "Percentage of children under five years who are underweight",
    "literacy": "Percentage of persons (15 years and above) who are literate",
    "drinking water": "Percentage of rural population having improved source of drinking water",
    "electricity": "Percentage of households electrified ",
    "unemployment": "Unemployment rate (%) (15-59 years)",
}

L = ["Andhra Pradesh",
     "Arunachal Pradesh",
     "Assam",
     "Bihar",
     "Chhattisgarh",
     "Goa",
     "Gujarat",
     "Haryana",
     "Himachal Pradesh",
     "Jharkhand",
     "Karnataka",
     "Kerala",
     "Madhya Pradesh",
     "Maharashtra",
     "Manipur",
     "Meghalaya",
     "Mizoram",
     "Nagaland",
     "Odisha",
     "Punjab",
     "Rajasthan",
     "Sikkim",
     "Tamil Nadu",
     "Telangana",
     "Tripura",
     "Uttar Pradesh",
     "Uttarakhand",
     "West Bengal",
     "Andaman and Nicobar Islands",
     "Chandigarh",
     "Dadra and Nagar Haveli",
     "Daman and Diu",
     "Delhi",
     "Jammu and Kashmir",
     "Ladakh",
     "Lakshadweep",
     "Puducherry"]

for i in range(1, len(L)+1):
    print(i, L[i-1])

n = 26

name = L[n-1]

x = list()
y = list()

for key in desc:
    val = df.loc[name, key]
    if(val == 'Null'):
        continue
    else:
        y.append(round(float(val), 2))
        x.append(key)

df = pd.DataFrame(dict(
    r=y,
    theta=x))

fig = px.line_polar(df, r='r', theta='theta', line_close=True, title=name)
fig.update_traces(fill='toself')
fig.show()
1 Andhra Pradesh
2 Arunachal Pradesh
3 Assam
4 Bihar
5 Chhattisgarh
6 Goa
7 Gujarat
8 Haryana
9 Himachal Pradesh
10 Jharkhand
11 Karnataka
12 Kerala
13 Madhya Pradesh
14 Maharashtra
15 Manipur
16 Meghalaya
17 Mizoram
18 Nagaland
19 Odisha
20 Punjab
21 Rajasthan
22 Sikkim
23 Tamil Nadu
24 Telangana
25 Tripura
26 Uttar Pradesh
27 Uttarakhand
28 West Bengal
29 Andaman and Nicobar Islands
30 Chandigarh
31 Dadra and Nagar Haveli
32 Daman and Diu
33 Delhi
34 Jammu and Kashmir
35 Ladakh
36 Lakshadweep
37 Puducherry
In [18]:
import pandas as pd
import plotly.graph_objs as go

df = pd.read_csv('cleaned_data.csv')
df.set_index('States_UT', inplace=True)

desc = {
    "poverty": "Percentage of population living below the national poverty line",
    "malnutrition": "Percentage of children under five years who are underweight",
    "literacy": "Percentage of persons (15 years and above) who are literate",
    "drinking water": "Percentage of rural population having improved source of drinking water",
    "electricity": "Percentage of households electrified ",
    "unemployment": "Unemployment rate (%) (15-59 years)",
}


L = ["Andhra Pradesh",
     "Arunachal Pradesh",
     "Assam",
     "Bihar",
     "Chhattisgarh",
     "Goa",
     "Gujarat",
     "Haryana",
     "Himachal Pradesh",
     "Jharkhand",
     "Karnataka",
     "Kerala",
     "Madhya Pradesh",
     "Maharashtra",
     "Manipur",
     "Meghalaya",
     "Mizoram",
     "Nagaland",
     "Odisha",
     "Punjab",
     "Rajasthan",
     "Sikkim",
     "Tamil Nadu",
     "Telangana",
     "Tripura",
     "Uttar Pradesh",
     "Uttarakhand",
     "West Bengal",
     "Andaman and Nicobar Islands",
     "Chandigarh",
     "Dadra and Nagar Haveli",
     "Daman and Diu",
     "Delhi",
     "Jammu and Kashmir",
     "Ladakh",
     "Lakshadweep",
     "Puducherry"]

for i in range(1, len(L)+1):
    print(i, L[i-1])

n = 1

name = L[n-1]

x = list()
y = list()

for key in desc:
    val = df.loc[name, key]
    if(val == 'Null'):
        continue
    else:
        x.append(key)
        y.append(round(float(val), 2))

fig = go.Figure()

fig.add_trace(
    go.Bar(
        x=x,
        y=y,
        marker=dict(color=y,
                    colorscale='viridis', showscale=True)
    )
)

fig.update_layout(
    go.Layout(
        title=name,
        xaxis=dict(
            title='parameters'
        ),
        yaxis=dict(
            title='value(in %)',
        )
    )
)

fig.show()
1 Andhra Pradesh
2 Arunachal Pradesh
3 Assam
4 Bihar
5 Chhattisgarh
6 Goa
7 Gujarat
8 Haryana
9 Himachal Pradesh
10 Jharkhand
11 Karnataka
12 Kerala
13 Madhya Pradesh
14 Maharashtra
15 Manipur
16 Meghalaya
17 Mizoram
18 Nagaland
19 Odisha
20 Punjab
21 Rajasthan
22 Sikkim
23 Tamil Nadu
24 Telangana
25 Tripura
26 Uttar Pradesh
27 Uttarakhand
28 West Bengal
29 Andaman and Nicobar Islands
30 Chandigarh
31 Dadra and Nagar Haveli
32 Daman and Diu
33 Delhi
34 Jammu and Kashmir
35 Ladakh
36 Lakshadweep
37 Puducherry
In [19]:
import pandas as pd
import plotly.graph_objs as go

df = pd.read_csv('cleaned_data.csv')
df.set_index('States_UT', inplace=True)

desc = {
    "poverty": "Percentage of population living below the national poverty line",
    "malnutrition": "Percentage of children under five years who are underweight",
    "literacy": "Percentage of persons (15 years and above) who are literate",
    "drinking water": "Percentage of rural population having improved source of drinking water",
    "electricity": "Percentage of households electrified ",
    "unemployment": "Unemployment rate (%) (15-59 years)",
}


L = ["Andhra Pradesh",
     "Arunachal Pradesh",
     "Assam",
     "Bihar",
     "Chhattisgarh",
     "Goa",
     "Gujarat",
     "Haryana",
     "Himachal Pradesh",
     "Jharkhand",
     "Karnataka",
     "Kerala",
     "Madhya Pradesh",
     "Maharashtra",
     "Manipur",
     "Meghalaya",
     "Mizoram",
     "Nagaland",
     "Odisha",
     "Punjab",
     "Rajasthan",
     "Sikkim",
     "Tamil Nadu",
     "Telangana",
     "Tripura",
     "Uttar Pradesh",
     "Uttarakhand",
     "West Bengal",
     "Andaman and Nicobar Islands",
     "Chandigarh",
     "Dadra and Nagar Haveli",
     "Daman and Diu",
     "Delhi",
     "Jammu and Kashmir",
     "Ladakh",
     "Lakshadweep",
     "Puducherry"]

for i in range(1, len(L)+1):
    print(i, L[i-1])

n = 4

name = L[n-1]

x = list()
y = list()

for key in desc:
    val = df.loc[name, key]
    if(val == 'Null'):
        continue
    else:
        x.append(key)
        y.append(round(float(val), 2))

fig = go.Figure()

fig.add_trace(
    go.Bar(
        x=x,
        y=y,
        marker=dict(color=y,
                    colorscale='viridis', showscale=True)
    )
)

fig.update_layout(
    go.Layout(
        title=name,
        xaxis=dict(
            title='parameters'
        ),
        yaxis=dict(
            title='value(in %)',
        )
    )
)

fig.show()
1 Andhra Pradesh
2 Arunachal Pradesh
3 Assam
4 Bihar
5 Chhattisgarh
6 Goa
7 Gujarat
8 Haryana
9 Himachal Pradesh
10 Jharkhand
11 Karnataka
12 Kerala
13 Madhya Pradesh
14 Maharashtra
15 Manipur
16 Meghalaya
17 Mizoram
18 Nagaland
19 Odisha
20 Punjab
21 Rajasthan
22 Sikkim
23 Tamil Nadu
24 Telangana
25 Tripura
26 Uttar Pradesh
27 Uttarakhand
28 West Bengal
29 Andaman and Nicobar Islands
30 Chandigarh
31 Dadra and Nagar Haveli
32 Daman and Diu
33 Delhi
34 Jammu and Kashmir
35 Ladakh
36 Lakshadweep
37 Puducherry
In [20]:
import pandas as pd
import plotly.graph_objs as go

df = pd.read_csv('cleaned_data.csv')
df.set_index('States_UT', inplace=True)

desc = {
    "poverty": "Percentage of population living below the national poverty line",
    "malnutrition": "Percentage of children under five years who are underweight",
    "literacy": "Percentage of persons (15 years and above) who are literate",
    "drinking water": "Percentage of rural population having improved source of drinking water",
    "electricity": "Percentage of households electrified ",
    "unemployment": "Unemployment rate (%) (15-59 years)",
}


L = ["Andhra Pradesh",
     "Arunachal Pradesh",
     "Assam",
     "Bihar",
     "Chhattisgarh",
     "Goa",
     "Gujarat",
     "Haryana",
     "Himachal Pradesh",
     "Jharkhand",
     "Karnataka",
     "Kerala",
     "Madhya Pradesh",
     "Maharashtra",
     "Manipur",
     "Meghalaya",
     "Mizoram",
     "Nagaland",
     "Odisha",
     "Punjab",
     "Rajasthan",
     "Sikkim",
     "Tamil Nadu",
     "Telangana",
     "Tripura",
     "Uttar Pradesh",
     "Uttarakhand",
     "West Bengal",
     "Andaman and Nicobar Islands",
     "Chandigarh",
     "Dadra and Nagar Haveli",
     "Daman and Diu",
     "Delhi",
     "Jammu and Kashmir",
     "Ladakh",
     "Lakshadweep",
     "Puducherry"]

for i in range(1, len(L)+1):
    print(i, L[i-1])

n = 26

name = L[n-1]

x = list()
y = list()

for key in desc:
    val = df.loc[name, key]
    if(val == 'Null'):
        continue
    else:
        x.append(key)
        y.append(round(float(val), 2))

fig = go.Figure()

fig.add_trace(
    go.Bar(
        x=x,
        y=y,
        marker=dict(color=y,
                    colorscale='viridis', showscale=True)
    )
)

fig.update_layout(
    go.Layout(
        title=name,
        xaxis=dict(
            title='parameters'
        ),
        yaxis=dict(
            title='value(in %)',
        )
    )
)

fig.show()
1 Andhra Pradesh
2 Arunachal Pradesh
3 Assam
4 Bihar
5 Chhattisgarh
6 Goa
7 Gujarat
8 Haryana
9 Himachal Pradesh
10 Jharkhand
11 Karnataka
12 Kerala
13 Madhya Pradesh
14 Maharashtra
15 Manipur
16 Meghalaya
17 Mizoram
18 Nagaland
19 Odisha
20 Punjab
21 Rajasthan
22 Sikkim
23 Tamil Nadu
24 Telangana
25 Tripura
26 Uttar Pradesh
27 Uttarakhand
28 West Bengal
29 Andaman and Nicobar Islands
30 Chandigarh
31 Dadra and Nagar Haveli
32 Daman and Diu
33 Delhi
34 Jammu and Kashmir
35 Ladakh
36 Lakshadweep
37 Puducherry
In [ ]: